package com.shuangti;

public class Fengzhuang {
/*
封装的概念
1 属性私有化
2 给私有的属性添加getter方法//获取属性值，setter方法//给属性赋值
3 给对象创建空参和全参构造器
4 给对象添加tostring方法
 */
    // 属性私有化
    private String brand;
    private double price;
    private int ram;
//2 给私有的属性添加getter方法//获取属性值，setter方法//给属性赋值
    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getRam() {
        return ram;
    }

    public void setRam(int ram) {
        this.ram = ram;
    }
    //3 给对象创建空参和全参构造器
    public Fengzhuang(){}
//全参构造器

    public Fengzhuang(String brand, double price, int ram) {
        this.brand = brand;
        this.price = price;
        this.ram = ram;
    }
    //

    @Override
    public String toString() {
        return "Fengzhuang{" +
                "brand='" + brand + '\'' +
                ", price=" + price +
                ", ram=" + ram +
                '}';
    }
}
